<template>
	<view>
		<view class="file-item" @click="tapFile">
			<view class="file-ico">
				<image :src="'../../static/'+type+'.png'"></image>
			</view>
			<view class="file-name">
				<view class="title">
					{{name}}
				</view>
				<view class="time">
					{{size}}MB,{{time}}
				</view>
			</view>
			<view class="file-folder-ico">
				<image v-if="type==='folder'" :src="'../../static/quan.png'"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			type: { //文件类型
				type: String,
				default: "folder",
				// folder,pdf,xls,ppt,doc 
			},
			name: String, //文件名
			size: Number, //文件大小
			time: String
		},
		data() {
			return {

			};
		},
		methods: {
			tapFile() {
				this.$emit('click',this.type)
			}
		}
	}
</script>

<style lang="less">
	.file-item {
		border-bottom: 1px solid #CCCCCC;
		padding: 12px 0 12px 0;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;

		.file-ico {
			width: 110rpx;
			height: 90rpx;
			margin-left: 5px;
			background: #09BB07;

			image {
				width: 110rpx;
				height: 90rpx;
			}
		}

		.file-name {
			width: 70%;
			flex: 1;
			margin-left: 10px;
			display: flex;
			flex-direction: column;
			word-wrap: break-word;
			word-break: normal;

			.title {
				font-size: 16px;
				font-weight: bold;
				line-height: 19px;
			}

			.time {}
		}

		.file-folder-ico {
			width: 30px;

			image {
				width: 60rpx;
				height: 60rpx;
			}
		}
	}
</style>
